<template>
  <div>
     <div class="father">
      <!-- v-blind class增强 对象式 -->
       <div class="box" :class="{active: a===1}" @click="a=1" >1</div>
       <div class="box" :class="{active :a===2}" @click="a=2">2</div>
       <div class="box" :class="{active:a===3}" @click="a=3">3</div>
 </div>
   </div>
</template>
 
<script>
export default {

  data() {
    return {
    a:1
    };
  },

  methods: {
   
  }
};
</script>

<style scoped>
    

     .box {
        border: 1px solid #333;
        width: 250px;
        height: 250px;
     }
     .father {
       display: flex;
     }
      .active {
        background-color: #087;
     }
</style>